package com.zhengke.service.gywm;

import com.zhengke.common.dao.CommonDao;
import com.zhengke.pojo.AboutPhone;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.util.List;

/**
 * *******************************
 * 项目名称：tvmallws
 * 文件名称：GywmServiceImpl
 * 类说明：  关于我们service实现类
 * 创建时间：2020/1/6 22:10
 *
 * @author 王鑫
 * @version 1.0
 * *******************************
 */
@Service
public class GywmServiceImpl implements GywmService {

    @Autowired
    private CommonDao dao;


    /**
     * 查询 id 和 typeName
     *
     * @return
     */
    @Override
    public List<AboutPhone> queryMsg() throws Exception {
        List<AboutPhone> rtnList = (List<AboutPhone>) dao.findForList("gywmMapper.selectById", null);
        return rtnList;
    }


    @Override
    public AboutPhone selectById(Integer id) throws Exception {
        AboutPhone ap = (AboutPhone) dao.findForObject("gywmMapper.selectById", id);
        return ap;
    }

    @Override
    public int toUpData(AboutPhone ap) throws Exception {
        int result = dao.update("gywmMapper.updateById", ap);
        return result;
    }

}